<template>
	<view class="content">
		<view class="subject">
			<view class="bg">
				<view class="top">
					<view class="user">
						<image src="../../static/1.png" mode=""></image>
						<text>码叔编程</text>
					</view>
					<view class="tab">
						<view class="desc">定金历史记录</view>
						<view class="text" @click="go">
							<text>同步订单数据</text>
							<image src="../../static/icon/3_07.png" mode=""></image>
						</view>
					</view>
					<view class="list" v-if="list.length>0">
						<view class="item" v-for="(item,index) in list" :key="index">
							<view class="left">
								<text class="desc">{{item.title}}</text>
								<view class="text">
									<image src="../../static/icon/3_16.png" mode=""></image>
									<text>{{item.price}}元</text>
								</view>
								<view class="text">
									<image src="../../static/icon/3_20.png" mode=""></image>
									<text>{{item.create_at}}</text>
								</view>
								<view class="text">
									<image src="../../static/icon/3_24.png" mode=""></image>
									<text>购买人：{{item.name}}</text>
								</view>
							</view>
							<view class="right">
								<image src="../../static/icon/3_11.png" mode="" v-if="item.status == 1"></image>
								<image src="../../static/icon/3_14.png" mode="" v-else></image>
								<text>邀请人:{{item.referer}}</text>
							</view>
						</view>
					</view>
					<u-empty mode="history" icon="http://cdn.uviewui.com/uview/empty/history.png" v-else>
					</u-empty>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				list: []
			};
		},
		onShow() {

		},
		onLoad() {
			this.initiate()
		},
		methods: {
			go() {
				this.initiate()
			},
			initiate() {
				let params = {
					"user_id": "12",
					"pageNum": 1
				}
				uni.request({
					url: `https://e.s8jd.com/prod-api/api/mock/request?url=/api/zsxq/getMyOrders`, // 服务器地址
					method: 'GET', // 请求方式
					data: params,
					success: (res) => {
						console.log(res)
						this.list = res.data
					},
					fail: (err) => {
						console.log(err)
					}
				})
			}
		},
	};
</script>

<style lang="scss" scoped>
	.content {
		.subject {
			position: relative;

			.bg {
				width: 750rpx;
				height: 445rpx;
				background: url("~@/static/bg1.png") no-repeat;
				background-size: 100% 100%;

				.top {
					width: 681rpx;
					height: 1256rpx;
					margin: 0 auto;
					position: relative;
					top: 70rpx;

					.user {
						width: 157rpx;
						margin: 0 auto;

						image {
							width: 157rpx;
							height: 157rpx;
							border-radius: 50%;
						}

						text {
							font-family: Microsoft YaHei;
							font-weight: bold;
							font-size: 33rpx;
							color: #171717;
							display: block;
							text-align: center;
							padding-top: 22rpx;
						}
					}

					.tab {
						width: 681rpx;
						display: flex;
						align-items: center;
						justify-content: space-between;
						margin-top: 68rpx;

						.desc {
							font-family: Microsoft YaHei;
							font-weight: 400;
							font-size: 25rpx;
							color: #6C6C6C;
						}

						.text {
							display: flex;
							align-items: center;

							text {
								font-family: Microsoft YaHei;
								font-weight: 400;
								font-size: 25rpx;
								color: #6C6C6C;
								padding-right: 10rpx;
							}

							image {
								width: 26rpx;
								height: 25rpx;
							}
						}
					}


					.list {
						.item {
							width: 681rpx;
							background: #FFFFFF;
							box-shadow: 0rpx 0rpx 17rpx 0rpx rgba(38, 175, 164, 0.05);
							border-radius: 21rpx;
							padding: 42rpx 56rpx 42rpx 50rpx;
							display: flex;
							align-items: center;
							justify-content: space-between;
							margin-top: 35rpx;

							.left {
								.desc {
									font-family: Microsoft YaHei;
									font-weight: bold;
									font-size: 31rpx;
									color: #171717;
								}

								.text {
									display: flex;
									align-items: center;
									padding-top: 16rpx;

									text {
										font-family: Microsoft YaHei;
										font-weight: 400;
										font-size: 25rpx;
										color: #6C6C6C;
										padding-left: 10rpx;
									}

									image {
										width: 26rpx;
										height: 26rpx;
									}
								}
							}

							.right {
								image {
									width: 126rpx;
									height: 109rpx;
									display: block;
								}

								text {
									font-family: Microsoft YaHei;
									font-weight: 400;
									font-size: 25rpx;
									color: #6C6C6C;
									display: block;
									padding-top: 40rpx;
								}
							}
						}
					}
				}
			}


		}

	}
</style>